package com.example.babara.memo.activity;

import android.app.Activity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.TextView;
import android.widget.Toast;

import com.example.babara.memo.R;

public class SettingsActivity extends Activity implements View.OnClickListener{
    private TextView bluetoothSettingText;
    private TextView backText;
    private TextView loginText;
    private TextView passwordSettingText;
    private TextView logoutText;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_settings);
        bindView();

    }

    public void bindView(){
        bluetoothSettingText = (TextView)findViewById(R.id.bluetooth_setting_text);
        backText = (TextView)findViewById(R.id.setting_back);
        loginText = (TextView)findViewById(R.id.login_text);
        passwordSettingText = (TextView)findViewById(R.id.password_settings_text);
        logoutText = (TextView)findViewById(R.id.logout_text);

        logoutText.setOnClickListener(this);
        bluetoothSettingText.setOnClickListener(this);
        backText.setOnClickListener(this);
        loginText.setOnClickListener(this);
        passwordSettingText.setOnClickListener(this);
    }

    @Override
    public void onClick(View v){
        switch (v.getId()){
            case R.id.bluetooth_setting_text:
                Intent intent = new Intent(SettingsActivity.this, ClientActivity.class);
                startActivity(intent);
                break;
            case R.id.setting_back:
                this.finish();
                break;
            case R.id.login_text:
                Intent intent1 = new Intent(SettingsActivity.this, LoginActivity.class);
                startActivity(intent1);
                break;
            case R.id.password_settings_text:
                Intent intent2 = new Intent(SettingsActivity.this, PasswordSettingActivity.class);
                startActivity(intent2);
                break;
            case R.id.logout_text:
                Toast.makeText(SettingsActivity.this, "您尚未登录", Toast.LENGTH_SHORT).show();
                break;
        }
    }
}
